import type { ResponseStruct } from '#/global'

export interface ShopGoodsVo {
  id: number
  // 创建时间
  created_at: string
  // 更新时间
  updated_at: string
}

// shop_goods查询
export function page(params: ShopGoodsVo): Promise<ResponseStruct<ShopGoodsVo[]>> {
  return useHttp().get('/admin/test/shop_goods/list', { params })
}

// shop_goods新增
export function create(data: ShopGoodsVo): Promise<ResponseStruct<null>> {
  return useHttp().post('/admin/test/shop_goods/create', data)
}

// shop_goods编辑
export function save(id: number, data: ShopGoodsVo): Promise<ResponseStruct<null>> {
  return useHttp().put(`/admin/test/shop_goods/save/${id}`, data)
}

// shop_goods删除
export function deleteByIds(ids: number[]): Promise<ResponseStruct<null>> {
  return useHttp().delete('/admin/test/shop_goods/delete', { data: ids })
}